﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Projektarbete
{
    class Chest : Tile
    {
        LinkedList<Item> contents;

        public Chest()
            : base(22, false)
        {
            contents = new LinkedList<Item>();
        }

        public override TileData GetData()
        {
            return new TileData(contents);
        }

        public override void SetData(TileData data)
        {
            //data.boolean = add
            if (data.boolean)
                contents.AddLast(data.item);
            else
                contents.Remove(data.item);
        }

        public override bool Interact()
        {
            PopupManager.OpenCloseChest();

            return true;
        }
    }
}
